<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
<script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
<script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>
<script src="/res/third/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/res/third/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
	function sosuo(){
		var lpath =location.pathname;
		var pageNo = $("#pageNo").val();
		$("#soform").attr("action",lpath+"?pageNo="+pageNo);
		$("#soform").submit();
	}

	function mark(financeid) {
        dialog = art.dialog({
            title : "备注",
            lock : true,
            content : $("#mark_dialog").html(),
			ok: function () {
                var memo = $("#auditOpinion").val();
                $.post('/finance/remark.do', { financeId: financeid, memo: memo }, function (data, textStatus, jqXHR) {
                        window.location.reload();
                    }
                );
            }
        });
    }

	function changestate(financeid){
		art.dialog.post({
			url:"/finance/o_changestate.do",
			data:{state:state,financeid:financeid},
			success:function(data){
				if(data.success){
					refresh();
				}else{
					art.dialog.tips(data.msg);
				}
			}
		});
	}
	
	
	function deletefinance(financeid){
		art.dialog.confirm("确定删除？",function(){
			art.dialog.post({
				url:"/finance/o_delete.do",
				data:{id:financeid},
				success:function(data){
					if(data.success){
						refresh();
					}
				}
				
			})
		},function(){
			
		})
	}
</script>
<script type="text/html" id="mark_dialog">
	<div style="width: 400px;height: 150px;">
		<textarea id="auditOpinion" name="auditOpinion" style="width: 100%;height: 100px;"></textarea>
	</div>
</script>
</head>

<body>
	<div class="panel panel-info panel-content">
		<div class="panel-heading">
		<form  id="soform" method="post">
		<table >
			<tr>
				<td class="w80" style="padding-top: 5px">
					<label for="companyname" class="center-block">企业名称：</label>
				</td>
				<td class="w150 ">
					<input type="text" class="form-control" name="so_companyname" value="${so_companyname!}" placeholder="企业名称" data-options="">
				</td>
				<td class="w80" style="padding-top: 5px; padding-left: 10px">
					<label for="role" class="center-block">企业类型：</label>
				</td>
				<td class="w120 ">
					<select class="form-control" name="so_role">
						<option value="">全部</option>
						<option value="1" [#if so_role??][#if '1'==so_role]selected[/#if][/#if]>采购商</option>
						<option value="2" [#if so_role??][#if '2'==so_role]selected[/#if][/#if]>供应商</option>
					</select>
				</td>
				<td style="padding-left: 10px">
					<div class="input-group">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button" onclick="sosuo()">搜索</button>
						</span>
					</div>
				</td>
			</tr>
		</table>
		</form>
		</div>
		<table class="table table-hover table-bordered table-striped table-condensed">
				<tr>
					<th>#</th>
					<th>申请企业名称</th>
					<th>企业身份</th>
					<th>联系人姓名</th>
					<th>联系人电话</th>
					<th>备注</th>
					<th>申请时间</th>
					<th>操作</th>
				</tr>
			[#list pagination.list as finance_apply ]
			<tr>
				<td align="center">${pagination.pageSize * (pagination.pageNo-1)+finance_apply_index+1}</td>
				<td align="center">${finance_apply.companyName!'无'}</td>
				<td align="center">
					[#if finance_apply.identity==1]采购商[/#if] 
					[#if finance_apply.identity==2]供应商[/#if]
				</td>

				<td align="center">${finance_apply.contactName!}</td>
				<td align="center">${finance_apply.contactTel!}</td>
				<td align="center">${finance_apply.memo!}</td>
				<td align="center">${finance_apply.createtime?string("yyyy-MM-dd HH:mm:ss")!}</td>
				<td align="center">
					<button type="button" onclick="mark(${finance_apply.id})"  class="btn btn-info btn-xs">备注</button>
					<button type="button"  onclick="deletefinance(${finance_apply.id})"  class="btn btn-default btn-xs delbtn">删除</button>
				</td>
			</tr>
			[/#list]
		</table>

		<div class="panel-footer">[@fenye p = pagination form = 'infoForm' /]</div>
	</div>
</body>
</html>
